<html><body>

<?php



// Make a MySQL Connection
$firstname = $_POST['firstname'];
$middlename = $_POST['middlename'];
$lastname = $_POST['lastname'];
$userpassword = $_POST['upassword'];
//$email = $_POST['uemail'];
$email = mysql_real_escape_string($_POST['uemail']);
$employeeid = $_POST['employeeid'];
$userid = $employeeid;
$userrole = $_POST['userrole'];

$useraccesslevel = 2;

$firstlogindate = date("Y/m/d");
$lastlogindate = date("Y/m/d");
$lastdatemodified = date("Y/m/d");


//$url = 'http://localhost/we/landing-page/welcome.html';
//$rootpath = getcwd();
//mysql_connect("localhost", "root", "n2pl") or die(mysql_error());


mysql_connect("localhost", "root", "n2pl") or die(mysql_error());
mysql_select_db("isb") or die(mysql_error());


/*
mysql_query("INSERT INTO accountlistnew 
(name,lastname, email, password, loginstatus) VALUES('$username','$usernamel', '$useremail', '$userpassword', '0' ) ") 
or die(mysql_error());
*/


mysql_query("INSERT INTO UserRoleId 
(UserId, UserAccessLevel, FirstLoginDate, LastLoginDate, LoginPassword, UserRoleDescription) VALUES('$userid','$useraccesslevel', '$firstlogindate', '$lastlogindate', '$userpassword' ,'$userrole') ") 
or die(mysql_error());

mysql_query("INSERT INTO employee 
(EmployeeId, EmployeeFirstName, EmployeeMiddleName, EmployeeLastName, EmailId, UserId, LastDateModified) VALUES('$employeeid','$firstname', '$middlename', '$lastname', '$email','$userid', '$lastdatemodified') ") 
or die(mysql_error());



//------------------------------------------------

$url = "http://localhost/isb/employeeindex.html";
$string = "\""."<a href=$url>login</a>"."\"";
echo "Register sucessfully";
echo $string;
//header( "Location: $url" );



?>

</body></html>

